package org.mozhu.mboot.admin.maintain.email.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.mozhu.mboot.admin.maintain.notification.entity.NotificationModule;
import org.mozhu.mboot.core.data.entity.BaseEntity;
import org.mozhu.mboot.core.data.entity.Stateable;

import javax.persistence.*;
import java.util.Date;

/**
 * 邮件通知 - 实体类
 */
@Entity
@Table(name = "maintain_email_notification")
@Data
@EqualsAndHashCode(callSuper = true)
public class EmailNotification extends BaseEntity implements Stateable<Stateable.ProcessStatus> {

    private static final long serialVersionUID = -6238855048391924816L;

    /**
     * 接收通知的用户邮箱
     */
    private String email;

    /**
     * 通知标题
     */
    private String title;

    /**
     * 通知内容
     */
    @Column(length = 10000)
    private String content;

    /**
     * 通知所属模块
     */
    @Enumerated(EnumType.STRING)
    private NotificationModule module;

    /**
     * 处理状态
     */
    @Enumerated(EnumType.STRING)
    private ProcessStatus status = ProcessStatus.pending;

    private Date processTime;

    /**
     * 处理信息（失败或成功时的）
     */
    @Column(length = 10000)
    private String processMessage;

}
